import {defineStore} from 'pinia'
import { reqTypeYear } from '../api'
export default defineStore("type",{
    state(){
        return {
            data:[]
        }
    },
    actions:{
        async append(){
            let result = await reqTypeYear()
            if(result.status == 200)
            this.data = result.data.data
        }
    },
    getters:{
        typeData(state){
            const result:string[] = []
            for(let i of state.data){
                result.push(i['name'])
            }
            return result
        }
    }
})